CyberStore Visitor Web Service
MethodCreateOnFileAccount
CyberStore Visitor Web Service > All Operations Resource Group : CreateOnFileAccount (Method)
Description
Creates an new on-file Account and new Customer. Introduced in 2023.1
Remarks
The CreateOnFileAccount process will attempt to create both a new Account and a new Customer, linking them together establishing the new On-FIle Account
 
Creating a new on-file Account requires the following fields
Failure to send the above fields with values  will cause the process to terminate .
 
If no shipping info is included, the process will use the billing address for the shipping address.
 
Iif an Account with the same Email Address exists, the process will terminate.
 
When creating a new Customer, the following logic will be utilized to determine the Customer Number value.
  1. Evaluate the SYSPRO Customer Number Format setting from SYSPRO Configuration setup
  2. If Numeric, attempt to get the next SYSPRO Customer Number using the IMPQIK e.net Query and 
    1. If SYSPRO returns the Numeric method as Automatic, then it will return the next available customer number which will be used, but
    2. If SYSPRO returns the Numeric method as Manual, then it will return null
  3. If Alphanumeric, or no next Customer Number could be returned then default to use the Primary Phone Number provided, stripping away non-numeric characters,
  4. If an error occurs or the method cannot be determined then a random number is generated of either 7 or 15 characters (SYSPRO versions before 7.0 are 7 characters, after 7.0 then 15)
  5. The customer number will be prefixed with leading zeros based on the configuration settings (Site Manager > A/R Configuration)
  6. Finally, an optional mask will be applied to the numbers based on the settings in SYSPRO Configuration (Note: if the masked result has more characters than a valid customer number, then the string is truncated from the left of the string to the maximum number of characters which is 7 or 15)
When a Customer Number is resolved a new Customer will be created using the Template Customer as configured in Site Manager > Site Configuration as a baseline from SYSPRO. This will also then set the Customer to the Customer Class to which the template customer is assigned, and therefore the Account will pick up any Account default Settings as established in Customer Class Maintenance. 
 
Finally upon completion of the process the new account will be logged in and all context for the shopper set to the new Account and Customer.
Request (CreateOnFileAccountSoapIn)

The request body is of type CreateOnFileAccount.

Request Body Parameters

NameDescriptionData Type
The email address for the Account.xml:string
The password to use for the Account.xml:string
The first name of the Account holder.xml:string
The last name of the Account holder.xml:string
The name of the company for the Account holder.xml:string
The primary phone number for the Account holder.xml:string
The primary phone extension for th e Account holder.xml:string
An optional, alternative phone number for the Account holderxml:string
An optional, alternative phone extenstion for the Account holderxml:string
The fax number for the Account holder.xml:string
Billing addresss line 1 for the Account.xml:string
Billing addresss line 2 for the Account.xml:string
Billing addresss line 3 for the Account.xml:string
Billing city for the Account.xml:string
Billing state for the Account.xml:string
Billing zip code for the Account.xml:string
Billing country for the Account.xml:string
Shipping address line 1 for the Account.xml:string
Shipping address line 2 for the Account.xml:string
Shipping address line 3 for the Account.xml:string
Shipping city for the Account.xml:string
Shipping state for the Account.xml:string
Shipping zip code for the Account.xml:string
Shipping country for the Account.xml:string
Example
The following example shows how to perform the web operation in CyberStore.
// Example: Create a new on-file account and customer

MakeAJAXCall("Visitor.CreateOnFileAccount", {
    Email: "address@email.com",
    Password: "123qwe",
    FirstName: "Barry",
    LastName: "Jones",
    CompanyName: "Whitehall",
    Telephone: "(508) 473-4825",
    TelephoneExtension: "123",
    AlternateTelephone: "(508) 555-1212",
    AlternateTelephoneExtension: "678",
    Fax: "(508) 555-1313",
    BillingAddress1: '123 Main Street',
    BillingAddress2: '',
    BillingAddress3: '',
    BillingCity: 'Alberquerque',
    BillingState: 'NM',
    BillingZipCode: '88888',
    BillingCountry: 'US',
    ShippingAddress1: '482 Sout Street',
    ShippingAddress2: 'Unit 322',
    ShippingAddress3: '',
    ShippingCity: 'Radiator Springs',
    ShippingState: 'NV',
    ShippingZipCode: '83522',
    ShippingCountry: 'US',
}, console.log)
200 Response (CreateOnFileAccountSoapOut)

The response body is of type CreateOnFileAccountResponse.

Response Body Parameters

NameDescriptionData Type

A string value containing a JSON object.

{
    "Data": {
        "CustomerNumber": "000000000000013",
        "CustomerName": "Out of Africa",
        "FirstName": "Barry",
        "LastName": "Jones",
        "Email": "address@test.dovetailinternet.com"
    },
    "LookupData": {},
    "Result": {
        "Success": true,
        "Message": "Customer '3864906629' was created successfully.The Shopper's on-file account has been updated successfully. The account has been logged-in successfully.",
        "ElapsedTime": "3741 ms"
    }
}

 

xml:string
See Also
All Operations Resource GroupCyberStore Visitor Web Service